<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="script/jquery-1.7.2.js"></script>
    <script>
        $(function () {
            alert($("div:has(span)").length)
        })
    </script>
</head>
<body>
<!--    <input disabled="disabled" type="checkbox" name="newsletter" value="HotFuzz">-->
<!--    <input type="radio" name="xxx">-->
<!--    <input type="button" value="1234">-->
    <div>div1</div>
    <div>div2</div>
    <div>div3 <span>div中的span</span></div>
</body>
</html>